/**
 * Created by xiteng on 2017/4/27.
 */
import React, {Component} from 'react';
import {
    Text,
    View,
    TouchableOpacity,
    Image,
} from 'react-native';

import Icon from 'react-native-vector-icons/Ionicons'
import Constant from '../../js/Contant'

export  class VerticalButton extends Component{
    render(){
        let {icon,title,iconStyle,index} = this.props
        return <View style={{justifyContent:'center',alignItems:'center'}} {...this.props}>
            <TouchableOpacity style={{justifyContent:'center',alignItems:'center'}}
                              onPress={()=>{
                                  this.props.onPress(index)
                              }}>
                <View style={{paddingVertical:5}}>
                    <Image source={icon} style={iconStyle}/>
                </View>
                <Text style={{color:Constant.TEXTTITLECOLOR,fontSize:12,fontWeight:'100'}}>{title}</Text>
            </TouchableOpacity>
        </View>
    }
}


export class VerticalTextButton extends Component{
    render(){
        let {subtitle,title} = this.props
        return <View style={{justifyContent:'center',alignItems:'center'}} {...this.props}>
            <TouchableOpacity style={{justifyContent:'center',alignItems:'center'}}
                              onPress={()=>{
                                  this.props.onPress()
                              }}>
                <Text style={{fontSize:14,fontWeight:'100',paddingVertical:5}}>{title+''}</Text>
                <Text style={{fontSize:13,fontWeight:'100'}}>{subtitle}</Text>
            </TouchableOpacity>
        </View>
    }
}


